package com.loong.seller.service.impl;

import com.loong.common.dubbo.service.AbstractService;
import com.loong.common.rest.rpc.RPCResponse;
import com.loong.common.utils.TransformUtils;
import com.loong.seller.dto.ShopTypeRPCResult;
import com.loong.seller.handler.ShopTypeHandler;
import com.loong.seller.service.IShopTypeService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

/**
 * @Description: 店铺分类RPC 实现
 * @Author: hzp
 * @Date: 2021-1-12 9:50
 */
@DubboService(timeout = 5000,interfaceClass = IShopTypeService.class)
public class ShopTypeRPCResultServiceImpl extends AbstractService implements IShopTypeService {
   @Resource
   private ShopTypeHandler shopTypeHandler;

    @Override
    public RPCResponse<ShopTypeRPCResult> findShopTypeById(Long id) {
        return serviceExecutor.execute(()-> TransformUtils.transform(shopTypeHandler.findShopTypeById(id),ShopTypeRPCResult.class));

    }
}
